// 工作流参数选项
export interface ParamOption {
    label: string
    value: string | number
}

// 工作流参数
export interface WorkflowParam {
    id: string
    type: string
    label: string
    description?: string
    required?: boolean
    default?: any
    options?: { label: string; value: any }[]
}

// 参数组
export interface WorkflowGroup {
    id: string
    title: string
    params: string[]  // 参数ID列表
}

// 工作流模板布局
export interface TemplateLayout {
    groups: WorkflowGroup[]
}

// 工作流模板
export interface WorkflowTemplate {
    version: string
    workflow: any
    params: WorkflowParam[]
    layout: TemplateLayout
}

// 工作流
export interface Workflow {
    id: string
    name: string
    title: string
    description: string
    type: string
    workflow: string  // JSON string
    template: string  // JSON string
    cover: string
    detailImage?: string
    samples: string[]
    tags: string[]
    isPublic: boolean
    serverIds: string[]
    excludeServerIds: string[]
    powerConsumption: number
    sort: number
    userId: string
    createdAt: string
    updatedAt: string
}

// 执行结果
export interface ExecutionResult {
    id: string
    status: 'success' | 'error'
    images: string[]
    error?: string
    startTime: string
    endTime: string
}

// 工作流节点类型
export interface WorkflowNode {
    id: string
    type: string
    position: {
        x: number
        y: number
    }
    data?: Record<string, any>
    inputs?: Record<string, any>
    outputs?: Record<string, any>
}

// 工作流连接类型
export interface WorkflowEdge {
    id: string
    source: string
    target: string
    type?: string
    data?: Record<string, any>
}

// 工作流配置类型
export interface WorkflowConfig {
    nodes: WorkflowNode[]
    edges: WorkflowEdge[]
}

// 工作流数据
export interface WorkflowData {
    id?: string
    name: string
    title: string
    description?: string
    type: string
    workflow: string
    template: string
    cover: string
    detailImage?: string
    samples: string[]
    isPublic: boolean
    serverIds: string[]
    excludeServerIds: string[]
    powerConsumption?: number
    sort?: number
    tags: string[]
    userId?: string
    createdAt?: string
    updatedAt?: string
} 